CREATE FUNCTION public.register_new_user(VARCHAR, VARCHAR, VARCHAR, CHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR)
	RETURNS INTEGER AS $$
DECLARE
	--n_firstname ALIAS FOR $1;
	emailId ALIAS for $1;
	--n_lastname ALIAS FOR $2;
	password ALIAS for $2;
	name ALIAS for $3;
	gender ALIAS for $4;
	address ALIAS for $5;
	city ALIAS for $6;
	state ALIAS for $7;
	country ALIAS for $8;
	zip ALIAS for $9;
	phone ALIAS for $10;
	dob ALIAS for $11;
	userid INTEGER;
BEGIN
	userid := NEXTVAL('public.client_seq');
	INSERT INTO public.client (user_id, email_id, password, name, gender, address, city, state, country, zip_code, phone, dob, doj, dola, registration_status)
		VALUES (userid, emailId, password, name, gender, address, city, state, country, zip, phone, dob, CURRENT_DATE, CURRENT_TIMESTAMP, P);

RETURN user_id;
END;

$$ LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER;
